/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vek.XML.parsedObjects;

import java.util.ArrayList;

/**
 * Simple class to contain the ParsedComercial data read by the XML Parsers.
 * This class is then used to create the Comercial object by giving this object to its constructor.
 * When a ParsedComercial object is created, the ParsedAttractions class takes care of its own variable changes.
 * @see ParsedAttractions
 * @author Christian, Michal og Jakob (Hold1, gruppe 2)
 */
         
public class ParsedComercial extends ParsedAttractions{
    
    public ParsedAttractions parsedAttractions;
    public ArrayList<ParsedProduct> products;
    public ArrayList<String> typesOfProductsSold;
    
    /**
     * 
     * @param pa the ParsedAttractions object which contains all the data from the parsedAttraction part of the XML as well as contain the data from the poi part of the XML
     * @param prod the product this object has
     * @param typesOfProd the types of product this object has
     */
    
    
    public ParsedComercial(ParsedAttractions pa, ArrayList<ParsedProduct> prod, 
                            ArrayList<String> typesOfProd)
    {
        super(pa);
        
        parsedAttractions = pa;
        products = prod;
        typesOfProductsSold = typesOfProd;
        
    }
    /**
     * @param pc the ParsedComecial object with the relevant data for this object
     */
    public ParsedComercial(ParsedComercial pc)
    {
        super(pc.parsedAttractions);
        
        products = pc.products;
        typesOfProductsSold = pc.typesOfProductsSold;
    }
    
    public String toString()
    {
        String s = super.toString();
        s += " products: ";
        for(int i = 0; i < products.size(); i++)
        {
            s += products.get(i); 
        }
        s += " types of products: ";
        for(int i = 0; i < typesOfProductsSold.size(); i++)
        {
            s += typesOfProductsSold.get(i);
        }
        
        return s;
    }

}
